home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
Other Langs
/
Tickle-4.0 (tcl)
/
src
/
think_support.c
< prev
next >
Wrap
Text File
|
1993-11-18
|
2KB
|
95 lines
/*
** This source code was written by Tim Endres
** Email: time@ice.com.
** USMail: 8840 Main Street, Whitmore Lake, MI 48189
**
** Some portions of this application utilize sources
** that are copyrighted by ICE Engineering, Inc., and
** ICE Engineering retains all rights to those sources.
**
** Neither ICE Engineering, Inc., nor Tim Endres,
** warrants this source code for any reason, and neither
** party assumes any responsbility for the use of these
** sources, libraries, or applications. The user of these
** sources and binaries assumes all responsbilities for
** any resulting consequences.
*/
#include <types.h>
#include <memory.h>
#include <stdlib.h>
#include <stdio.h>
#include <ioctl.h>
#include <math.h>
/*
* hypot - math function that is not supported by Think C
*/
double hypot(x, y)
double x, y;
{
double sum;
sum = (x * x) + (y * y);
return sqrt( sum );
}
char *
cbMALLOC( int size )
{
return malloc( size );
}
#ifdef NEVER
/*
** Experiments with AEBuild translation from MPW...
*/
int __nw__FUi;
int __dl__FPv;
LDIVT( long l1, long l2 )
{
return l1 / l2;
}
#endif
int
ioctl( int fildes, unsigned int cmd, long *arg )
{
int result = -1;
char buf[128];
switch (cmd)
{
case FIOINTERACTIVE:
result = -1;
break;
case FIOREFNUM:
*(short *)arg = __file[fildes].refnum;
result = 0;
break;
case FIOSETEOF:
result = SetEOF( __file[fildes].refnum, (long)arg );
if (result != noErr)
result = -1;
break;
default:
#ifdef NEVER_DEFINED
sprintf(&buf[1], "ioctl() fildes = %d cmd = %d ",
fildes, cmd);
buf[0] = strlen(&buf[1]);
DebugStr(buf);
#endif
result = -1;
break;
}
return result;
}